#pragma once

#include "ukuiwindowmanager.h"

#include <QWidget>
#include <qpoint.h>

namespace ukuiwaylandclient
{
// UkuiWindowPicker is a widget that allows users to select a window by clicking on it.
// It is designed to be frameless and translucent, covering the entire screen.
// After a window is selected, it emits a signal with the position of the click.

class UkuiWindowPicker : public QWidget
{
    Q_OBJECT
public:
    explicit UkuiWindowPicker(UkuiWindowManager *windowmanager);
    ~UkuiWindowPicker();

signals:
    void windowSelected(QPoint position);

private:
    void mouseMoveEvent(QMouseEvent *event) override;
    void mousePressEvent(QMouseEvent *event) override;
    void paintEvent(QPaintEvent *event) override;

    QPoint m_cursorPos = QPoint(0, 0);
    UkuiWindowManager *m_windowManager = nullptr;
};

} // namespace ukuiwaylandclient